<!--
 * @Author: your name
 * @Date: 2021-04-01 11:40:19
 * @LastEditTime: 2021-04-02 13:38:37
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \active-front\src\components\Notfound\index.vue
-->
<template>
  <div>404</div>
</template>

<script>
import userApi from "../../api/user.js";
export default {
  data() {
    return { s: 3, timeOut: "" };
  },
  created() {
    this.$message({
      showClose: true,
      message: `页面不存在,3秒后将自动跳转`,
      type: "error"
    });
  },
  methods: {},
  mounted() {
    let that = this;
    const token = userApi.getToken();
    this.timeOut = setTimeout(() => {
      console.log(that.$router);
      if (token) {
        this.$router.push("/info");
      } else {
        this.$router.push("/login");
      }
    }, 3000);
  },
  destroyed() {
    clearTimeout(this.timeOut);
  }
};
</script>
